//
//  ListTableViewCell.m
//  Jwy-ijkplayerDemo
//
//  Created by XiaoMing on 16/8/11.
//  Copyright © 2016年 JWY. All rights reserved.
//

#import "ListTableViewCell.h"
#import "listModel.h"
#import "UIImageView+WebCache.h"
@implementation ListTableViewCell

- (void)awakeFromNib {
    // Initialization code
    
    _iconImage.layer.cornerRadius = _iconImage.frame.size.width/2;
    _iconImage.layer.masksToBounds = YES;
    CALayer *layer = [_iconImage layer];
    layer.borderColor = [[UIColor purpleColor] CGColor];
    layer.borderWidth = 1.5f;
    
}
-(void)setModel:(listModel *)model{
    _model=model;
    
    // 用户名
    _nameLabel.text = model.name;
    
    // 用户所在城市
    if ([model.city isEqualToString:@""]) {
        [_address setTitle:@"难道在火星?" forState:(UIControlStateNormal)];
    }else{
        [_address setTitle:model.city forState:(UIControlStateNormal)];
    }
    
    // 用户Image
    [_iconImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://img.meelive.cn/%@",model.portrait]]];
    // 封面Image
    [_coverImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://img.meelive.cn/%@",model.portrait]]];
    
    // 观看人数
    _peopleNumber.text = [NSString stringWithFormat:@"%@",model.online_users];

}




- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
